/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Helpers;

import AreaDeDesenho.PainelDeDesenho;
import Formas.Circulo;
import Formas.CirculoPreenchido;
import Formas.Retangulo;
import java.awt.Color;
import java.awt.Graphics;

/**
 *
 * @author Lilli
 */
import Formas.Forma;
import Formas.Linha;
import Formas.Poligono;
import Formas.PoligonoPreenchido;
import Formas.RetanguloArrendondado;
import Formas.RetanguloArrendondadoPreenchido;
import Formas.RetanguloPreenchido;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.LinkedBlockingQueue;
public class Funcoes {

    public static Forma desenhaForma(EFormas f,Color c, Graphics g, int x, int y, int width, int height,int arcWidth, int arcHeight, int prop, int x1, int y1)
    {
        Forma forma = null;
        switch(f)
        {
            case RETANGULO :
                forma = new Retangulo(x, y, width, height);
            break;
            case CIRCULO :
                forma = new Circulo(x, y, width, height);
            break;
            case FILL_CIRCULO :
                forma = new CirculoPreenchido(x, y, width, height);
            break;            
            case FILL_RETANGULO :
                forma = new RetanguloPreenchido(x, y, width, height);
            break;
            case RETANGULO_ARRENDONDADO :
               forma = new RetanguloArrendondado(x, y, width, height, arcWidth, arcHeight);
            break;
            case FILL_RETANGULO_ARRENDONDADO :
               forma = new RetanguloArrendondadoPreenchido(x, y, width, height, arcWidth, arcHeight);
            break;
            case TRIANGULO :
                forma = new Poligono(new int[]{x,x+(prop*10),(x + (prop*22))}, new int[]{y+(22*prop),y,(y+prop*22)},3);
            break;
            case FILL_TRIANGULO :
                forma = new PoligonoPreenchido(new int[]{x,x+(prop*10),(x + (prop*22))}, new int[]{y+(22*prop),y,(y+prop*22)},3);
            break;
            case LINE:
                if(x1 == -1 && y1 == -1)
                forma = new Linha(x, y, 20, prop);
                else
                forma = new Linha(x, y, 20, prop, x1, y1);
            break;
        }

        if(forma != null)
        {
         forma.setCor(c);
         forma.drawForma(g);
        }
        g.dispose();
        return forma;
    }
}
